package lzzy.edu.cn.demothymeleaf.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

@Service
public class Task {
    @Async
    public void synTask() throws InterruptedException {
        System.out.println("请求时间"+ LocalDateTime.now());
        Thread.sleep(5000);
        System.out.println("相应时间"+ LocalDateTime.now());
    }
}
